from tortoise import BaseDBAsyncClient

RUN_IN_TRANSACTION = True


async def upgrade(db: BaseDBAsyncClient) -> str:
    return """
        CREATE TABLE IF NOT EXISTS `stu_info` (
    `stu_id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '学生编号',
    `stu_class_name` VARCHAR(100) NOT NULL COMMENT '学生班级名称',
    `stu_name` VARCHAR(100) NOT NULL COMMENT '学生姓名',
    `stu_jiguan` VARCHAR(100) NOT NULL COMMENT '籍贯',
    `stu_university` VARCHAR(100) NOT NULL COMMENT '院校',
    `stu_major` VARCHAR(100) NOT NULL COMMENT '专业',
    `stu_start_time` VARCHAR(100) NOT NULL COMMENT '入学时间',
    `stu_end_time` VARCHAR(100) NOT NULL COMMENT '毕业时间',
    `stu_major_level` VARCHAR(100) NOT NULL COMMENT '学历',
    `stu_hr_id` INT NOT NULL COMMENT '顾问编号',
    `stu_age` INT NOT NULL COMMENT '年龄',
    `stu_gender` VARCHAR(100) NOT NULL COMMENT '性别'
) CHARACTER SET utf8mb4;
CREATE TABLE IF NOT EXISTS `job` (
    `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `stu_name` VARCHAR(100) NOT NULL COMMENT '学生姓名',
    `stu_class_name` VARCHAR(100) NOT NULL COMMENT '学生班级名称',
    `open_time` VARCHAR(100) NOT NULL COMMENT '就业开放时间',
    `offer_time` VARCHAR(100) NOT NULL COMMENT 'offer下发时间',
    `company_name` VARCHAR(100) NOT NULL COMMENT '就业公司名称',
    `salary` INT NOT NULL COMMENT '就业薪资',
    `stu_id_id` INT NOT NULL,
    CONSTRAINT `fk_job_stu_info_00743ec1` FOREIGN KEY (`stu_id_id`) REFERENCES `stu_info` (`stu_id`) ON DELETE CASCADE
) CHARACTER SET utf8mb4;
CREATE TABLE IF NOT EXISTS `score` (
    `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `stu_name` VARCHAR(100) NOT NULL COMMENT '学生姓名',
    `stu_class_name` VARCHAR(100) NOT NULL COMMENT '学生班级名称',
    `test_time` INT NOT NULL COMMENT '考核序次',
    `stu_grade` DOUBLE NOT NULL COMMENT '成绩',
    `stu_id_id` INT NOT NULL,
    CONSTRAINT `fk_score_stu_info_5d2809fb` FOREIGN KEY (`stu_id_id`) REFERENCES `stu_info` (`stu_id`) ON DELETE CASCADE
) CHARACTER SET utf8mb4;
CREATE TABLE IF NOT EXISTS `aerich` (
    `id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `version` VARCHAR(255) NOT NULL,
    `app` VARCHAR(100) NOT NULL,
    `content` JSON NOT NULL
) CHARACTER SET utf8mb4;"""


async def downgrade(db: BaseDBAsyncClient) -> str:
    return """
        """


MODELS_STATE = (
    "eJztmltvm0gUx79KxFNX8q64G/fNcROt22xSOdtqpaayBjhgEjy4MLS1qnz3nRluhtjERI"
    "mHqH5B+Mw5MOfnufxnhl/SMnIhTP56H9nS25NfEkZLoDeb5sGJhFarysgMBNkh97vNHeyE"
    "xMgh1OShMAFqciFx4mBFgghTK07DkBkjhzoG2K9MKQ6+pTAnkQ9kATEt+PKVmgPswk9Iip"
    "+ru7kXQOjWKhm47N3cPifrFbdNMTnnjuxt9tyJwnSJK+fVmiwiXHoHmDCrDxhiRIA9nsQp"
    "qz6rXZ5kkVFW08olq+JGjAseSkOyke6eDJwIM360NglP0Gdv+VNV9KFuaaZuURdek9IyvM"
    "/Sq3LPAjmBy3+le16OCMo8OMaKW0LSOb9/QG+yQPF2fJsxDYi06k2IBbI2ioWhwlg1nVaO"
    "0k1q2KZ5kw4NxaP3I1ejV13OKv043SX6OQ8B+2RBfyqy3MLy83g2+Xs8e0O9/mBPj2gjzx"
    "r+ZV6kZmUMeB2wE6IkeRLmemS/YA81cOkV0DBDTu9Hntwb8NEKKKqgG/NaUA9wO5pyk+qg"
    "IHrvyfJNahoasKtH/4aR4en9we15EHfnXYsSDZzXhvGWbcpbc5Veknai5QrhdefxpBknmn"
    "ajeSumw6B7Vi9HkwSFKF530BhVwOM645CcLQOxq6vv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